From 2c4bd8d5640579222dc84e0026877fa92c445393 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Mon, 19 Feb 2024 13:16:33 +0700
Subject: Update variant api, ignore flashsale price

---
 src-migrate/pages/api/product-variant/[id].tsx | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

(limited to 'src-migrate/pages/api/product-variant/[id].tsx')

diff --git a/src-migrate/pages/api/product-variant/[id].tsx b/src-migrate/pages/api/product-variant/[id].tsx
index 39a871b7..955fde6a 100644
--- a/src-migrate/pages/api/product-variant/[id].tsx
+++ b/src-migrate/pages/api/product-variant/[id].tsx
@@ -30,7 +30,6 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
 const map = async (variant: any, price_tier: string) => {
   const data: any = {}
   const price = variant[`price_${price_tier}_v2_f`] || 0
-  const isFlashsale = checkIsFlashsale(variant)
 
   data.id = parseInt(variant.id)
   data.parent_id = variant.template_id_i
@@ -38,11 +37,7 @@ const map = async (variant: any, price_tier: string) => {
   data.image = variant.image_s
   data.name = variant.name_s
   data.default_code = variant.default_code_s
-  data.price = {
-    discount_percentage: isFlashsale ? variant.flashsale_discount_f : 0,
-    price: isFlashsale ? Math.round(variant.flashsale_base_price_f) : price,
-    price_discount: isFlashsale ? Math.round(variant.flashsale_price_f) : price
-  }
+  data.price = { discount_percentage: 0, price, price_discount: price }
 
   return data
 }
-- 
cgit v1.2.3

